<?php
$this->render('include/sortLink.phtml');
echo $this->render('collection/list/_tab.phtml');
$this->headScript()->appendFile(_STATIC_HTTP . '/jquery/checkAll.js');
if(!function_exists('__sortLink')) {
	function __sortLink() {}
}
?>
<form action="" method="post">
<div class="body">
	<table class="list">
		<tr>
			<th class="narrow sort"><?php echo __sortLink('id', '#');?></th>
			<th class="narrow sort"><?php echo __sortLink('link', 'KEY');?></th>
			<th><?php echo $this->language('MESSAGE');?></th>
			<th class="time sort"><?php echo __sortLink('date', 'TIME');?></th>
			<th class="narrow center"><?php echo '<input type="checkbox" name="select-all" id="select-all" value="1" rel="id[]" />';?></th>
		</tr>
		<?php foreach($this->list AS $row) { ?>
		<tr>
			<td class="center"><?php echo $row->getId();?></td>
			<td class="key"><?php 
				if($row->getUrl()) {
					echo '<a href="' . $row->getUrl() . '" target="_blank" title="Visit Url">' . $row->getLink() . '</a>';
				} else {
					echo $row->getLink();	
				}
			?></td>
			<td><?php echo $row->getMessage();?></td>
			<td class="time"><?php echo $this->date($row->getCreationtime());?></td>
			<td class="center"><?php
				if(in_array($row->getId(), $this->checkedList)) {
					$checked = array('checked' => 'checked');
				} else {
					$checked = array();
				}
				echo $this->form()->checkbox('id[]', $row->getId(), array_merge(array('id' => 'id-' . $row->getId()), $checked));
			?></td>
		</tr>
		<?php } ?>
		<?php if(count($this->list) <= 0) {?>
		<tr>
			<td colspan="6" class="nohover">
				<div class="msg">
					<div class="common error" style="border:0;background:#fff;">
						<i class="icon"></i>
						<h4>STOP</h4>
						<div class="msg-bd">
							No Error found. 
							<a href="<?php echo $this->url('collection/error/list');?>"><?php echo $this->language('Back')?>»</a>
						</div>
					</div>
				</div>
			</td>
		</tr>
		<?php } ?>
	</table>
</div>
<div class="body">
	<div style="float:right;margin-bottom:5px;">
		<?php echo $this->render('include/deleteButton.phtml');?>
	</div>
	<?php echo $this->paginator($this->list)->render();?>
</div>
</form>
